/* Autoboxing.java Created on 07/giu/2012 */
package it.tommasocortonesi.scjp.cap4;

/**
 * Osservazioni su Autoboxing delle classi wrapper
 *
 * @author 		tommasocortonesi
 * @version 	1.0, 07/giu/2012
 */
public class Autoboxing {
	public static void main(String[] args) {
		Integer i1 = 1000;
		Integer i2 = 1000;
		Integer i3 = 10;
		Integer i4 = 10;
		
		System.out.println("(i1 != i2)? " + (i1 != i2));
		System.out.println("(i1 == i2)? " + (i1 == i2));
		System.out.println("(i1.equals(i2))? " + (i1.equals(i2)));
		System.out.println("(i1 != i3)? " + (i1 != i3));
		System.out.println("(i1 == i3)? " + (i1 == i3));
		System.out.println("(i1.equals(i3))? " + (i1.equals(i3)));
		
		System.out.println("(i3 == i4)? " + (i3 == i4)); 	// to save memory, two instance of 
															// Boolean, Byte, Character (from \u0000
															// to \u007f) Short and Integer (from -128
															// to 127) will be ==
	}	
}
